package com.liuqi.openai.tool;

import com.liuqi.openai.core.chat.Tool;

import static com.liuqi.openai.util.ValidationUtil.ensureNotBlank;
import static com.liuqi.openai.util.ValidationUtil.ensureNotNull;

/**
 * @author liuqi
 * @date 2025/7/20
 **/
public abstract class AbstractCustomTool<T> implements CustomTool<T> {

    /**
     * 工具名称
     */
    private final String toolName;

    /**
     * openai tool 描述
     */
    private final Tool chatTool;

    public AbstractCustomTool(String toolName, Tool chatTool) {
        this.toolName = ensureNotBlank(toolName, "toolName");
        this.chatTool = ensureNotNull(chatTool, "tool");;
    }

    @Override
    public String toolName() {
        return toolName;
    }

    @Override
    public Tool chatTool() {
        return chatTool;
    }

}
